package com.lcu.student.mapper;

import com.lcu.student.entity.Teacher;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface TeacherMapper {

    /**
     * 查询所有教师姓名，及教师编号
     * @return
     */
    @Select("select teacher_number,teacher_name from  teacher Group BY teacher_number")
    public List<Teacher> selectTeacher();


    /**
     * 带条件的教师表查询
     *
     * @param begin
     * @param size
     * @param teacher
     * @return
     */
    List<Teacher> selectByPage(@Param("begin") int begin, @Param("size") int size, @Param("teacher") Teacher teacher);

    /**
     * 将分页查询的总数查出来
     * @param teacher
     * @return
     */
    int selectTotalCount(Teacher teacher);

    /**
     * 根据id删除教师数据
     * @param id
     */
    void deleteById(Integer id);

    /**
     * 根据ids批量删除数据
     * @param ids
     */
    void deleteByIds(@Param("ids") List<Integer> ids);

    /**
     * 添加数据
     * @param teacher
     */
    void addTeacher(Teacher teacher);

    /**
     * 根据id修改数据
     * @param teacher
     */
    void updateById(Teacher teacher);
}
